<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib uri="http://www.springframework.org/security/tags" prefix="sec"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>

<table>
	<tbody>
		<c:choose>
   			 <c:when test="${empty allAdvertisers}">
       			 <tr/>
       			 <tr/>
       			 <tr>
       			 	<td>
       					 No adverts.
       				</td>
       			 </tr>
  			  </c:when>
   			 <c:otherwise>
   			 	<tr>
					<td>Uploaded adverts</td>
				</tr>
        		<c:forEach items="${allAdvertisers}" var="currentAdvertiser">
					<tr>
						<td>${currentAdvertiser.username}</td>
						<td><a href="${pageContext.request.contextPath}/admins/deleteAdvertiser/${currentAdvertiser.id}">Delete</a></td>
					</tr>
				</c:forEach>
    		</c:otherwise>
		</c:choose>
	</tbody>
</table>

<br><br>
<a href="${pageContext.request.contextPath}/home">Home</a>
</body>
</html>